package com.example.login.controller;

import com.example.login.biz.PingLunBiz;
import org.example.bean.GuanJianZiInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
@RequestMapping("/pinglun")
public class PingLunController {
    @Autowired
    private PingLunBiz pb;

    @RequestMapping(value = "/find",produces = {"application/json;charset=utf-8"})
    @ResponseBody
    public Map<String,Object> findUserByPage(@RequestParam(defaultValue = "1") int page){
        return pb.findUserByPage(page);
    }

    @RequestMapping(value = "/del")
    public String deletePingLun(int tushuid) {
      pb.deletePingLun(tushuid);
      return "redirect:/reviewManage.htm";
    }

    @RequestMapping(value = "/save")
    public String  savePingLun(String textfield2) {
       pb.savePingLun(textfield2);
        return "redirect:/reviewManage.htm";
    }
    @RequestMapping(value = "/finds",produces = {"application/json;charset=utf-8"})
    @ResponseBody
    public Map<String,Object> findAllGuanJianZi(@RequestParam(defaultValue = "1") int page){
        return pb.findAllGuanJianZi(page);
    }

}
